<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>

<title>库房分配</title>
<style type="text/css">
td {
	font-size: 14px;
	text-align: center;
}

input {
	text-align: center;
}

table {
	text-align: center;
}
	
#sousuo1{
			background-image:img/search-icon.png;
				position: relative;
					top: -18px;
					left:-15px
										
		}	
#xinxi{
				display: none;
				background-color: powderblue;
				position: absolute;
				left:700PX;
				top: 180px;
			}	
		
</style>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/index.css" />

<script src="js/bootstrap3.7.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js"></script>
<!-- 动态菜单JS -->
<script type="text/javascript" src="js/menu.js"></script>
</head>

<body>

	<div class="container">
		<div class="cont-top">
			<div class="companyname">ERP管理系统</div>
			<div class="cont-top-middle">
				<ul>
					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon.png">
							</div>
							<div class="top-txt">购物单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

				</ul>
			</div>
			<div class="cont-top-rg">
				<ul class="advanced-menu">
					<li>
						<div class="top-search">
							<div class="t-s-l">
								<span class="left-line"></span> <input type="text" value="搜库存"
									class="search-type" disabled> <span
									class="triangle-bottom"></span>
							</div>
							<div class="t-s-l">
							
		
		
		<form action="BuyServlet?act=sousuo" method="post">
		<input type="text" placeholder="请输入商品编码或名称" name="sou" class="search-dt"> 
									<span class="right-line"></span>
										
									<span class="right-icon"> <span class="right-line">
									
									<input type="submit" value="搜索" id="sousuo1" /></span>	
								</form> 
									
									
									
									
									
							</div>
						</div>
					</li>
					<li class="default" style="position: relative;"><span
						class="user"><img src="img/user.png"></span> <a 
						class="special" onclick="denglu()">${user.name}
						<i><img src="img/xl.png"></i></a>
						<div class="drop-down-wrap"
							style="width: 180px; left: 15px; display: none;">
							<div class="drop-down">
								<span class="triangle-border"></span> <span class="triangle-bg"></span>
								<ul class="del-ul">
									<li><a href="#" class="hot">首耀照明</a></li>
									<li><a href="#">小丫头</a></li>
									<li><a href="#">操作日志</a></li>
								</ul>
							</div>
						</div></li>
				</ul>
				<ul class="advanced-menu">
					<li id="p"  style="display: none;"  >${user.grade}</li>
					<li id="anhao" style="display: none;" >${anhao}</li>
					<li><a href="#"><img src="img/top-icon3.png"></a></li>
					<li><a href="#"><img src="img/top-icon4.png"></a></li>
					<li><a href="#"><img src="img/top-icon5.png"></a></li>
				</ul>
			</div>
		</div>
		<div class="left-menu" style="height: 949px;">
			<div class="menu-list">
				<ul>
					<li class="menu-list-01">

						<p class="fumenu">库房管理</p> <img class="xiala" src="img/xiala.png" />

						<div class="list-p">
							<a href="BuyServlet?act=kufang2">
								<p class="zcd" id="zcd5">入库单</p>
							</a>
							<a href="BuyServlet?act=weixiu_show" id="weixiua" ><p class="zcd" id="zcd6">维修单</p></a>
							
						</div>
					</li>

					<li class="menu-list-02"><a href="ckgl.html">
							<p class="fumenu">产品管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd5">产品库存</p>
							<p class="zcd" id="zcd6">产品成本</p>
							<p class="zcd" id="zcd7">产品属性管理</p>
						</div></li>

					<li class="menu-list-01"><a href="dd-ddgl.html">
							<p class="fumenu">订单管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd8">下单账户</p>
							<p class="zcd" id="zcd9">所属员工</p>
							<p class="zcd" id="zcd10">订单成本</p>
							<p class="zcd" id="zcd1">订单成本费用</p>
							<p class="zcd" id="zcd12">订单总支付金额</p>
							<p class="zcd" id="zcd3">订单商品</p>
							<p class="zcd" id="zcd14">手动增加订单</p>
						</div></li>

					<li class="menu-list-02"><a href="cj-ckd.html">
							<p class="fumenu">财务管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd15">记录出款和入款</p>
							<p class="zcd" id="zcd16">计算一段时间的利润</p>
						</div></li>

					<li class="menu-list-01"><a href="kh-khgl.html">
							<p class="fumenu">客户管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd17">客户基本信息</p>
							<p class="zcd" id="zcd18">客户VIP登记管理</p>
							<p class="zcd" id="zcd19">客户信息管理</p>
							<p class="zcd" id="zcd20">客户订单管理</p>
							<p class="zcd" id="zcd21">转移客户</p>
						</div></li>

					<li class="menu-list-02"><a href="yg-jbxx.html">
							<p class="fumenu">员工管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd22">员工基本信息</p>
							<p class="zcd" id="zcd23">员工权限</p>
							<p class="zcd" id="zcd24">开通新客户</p>
							<p class="zcd" id="zcd25">销售额管理</p>
						</div></li>
				</ul>
			</div>
		</div>

		<div class="right-menu">
			<div class="main-hd">
				<div class="page-teb">
					<div class="l-tab-links">
						<ul style="left: 0;">
							<li class="l-select"><a href="index.jsp"
								style="padding: 0px 25px;">首页</a></li>
							<li class="l-select"><a href="#">库房分配</a> <span
								class="close"></span></li>
						</ul>
					</div>

					<div class="l-tab-content" style="background: #fff;">
						<div class="tab-content-item">
							<div class="home">
								<!--库房分配   开始-->
								<div class="kufang-box">
									<div class="kufang">
										<div class="kf-fl">
											<ul>
												<li>价格方式：<span>库存成本价</span></li>
												<li style="display: none;">仓库：<span>天津站</span></li>
												<li style="display: none;">时间：<span>2016-08-15至2017-08-25</span></li>
											</ul>
										</div>

										<div class="kf-rg">
											<ul>
												<li id="baofeix" ><span><input type="checkbox" onclick="baofei()">选择报废</span>
												</li>
												<li><span><input type="checkbox" value="true">显示停用商品</span>
												</li>
												<li><span>过滤 <select class="kf-in" id="change"
														onchange="change(this.value)">
														<option>选择过滤</option>
															<option>显示全部</option>
															<option>维修申请</option>
															<option>已领用</option>
															<option>未领用</option>
															<option>已报废</option>
													</select>
												</span></li>
											</ul>
										</div>
									</div>
								</div>

								<div class="kf-tab">
									<div class="headerbar-kf">
										<table class="headerbar" border="0" cellpadding="0"
											cellspacing="1">
										</table>
									</div>


									<div class="" tabindex="0">
										<table border="0" cellpadding="0" cellspacing="1"
											class="fkbody-rows" style="width: 100%;">
											<tbody>


												<td class="caption cao-l">

													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;" id="anhao" name=${anhao}  >产品编号</div>
												</td>

												<td class="caption cao-l">

													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产编码</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">商品名称</div>
												</td>
												
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">使用状况</div>
												</td>
												
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">使用人</div>
												</td>
												
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">入库时间</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">是否领用</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">操作日志</div>
												</td>

												</tr>
											</tbody>

											<tbody>
												<form action="BuyServlet?act=lingyong" method="post"
													id="container" onsubmit="return checkSubmit();" >
													
													<c:set var="a" value="${yeshu}"></c:set>
													<c:set var="b" value="1"></c:set>
													<c:forEach var="i" begin="0" end="19"  >
													
													<c:set var="p" value="${list1[i]}"></c:set>
													
														<tr class="fkbody-s" _rowindex="0"> 
															<td class="caption-kf" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id="yeshu${b}"  style="margin-left: 50px;" >${a}</div>
															</td>
															<td class="bodyrow-list" _columnindex="0">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: center;">
																	<input type="text" value='${p.zichanbianma}' id='zichan${p.num}'
																		
																		
																		readonly="readonly"  />
																</div>
															</td>
															<td class="bodyrow-list" _columnindex="1">
																<div class="bodytxt"
																	style="overflow: hidden;   text-align: center;" id=ming${p.num}>${p.zichanming}</div>
															</td>
																		<td class="bodyrow-list" align _columnindex="10">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">
																	<input type="text" id=shiyong${p.num}
																		value='${p.shiyongzhuangkuang}' readonly="readonly"
																		onclick="erea()" />
																</div>
															</td>
															
															<td class="bodyrow-list" align _columnindex="13">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">
																	<input type="text" readonly="readonly" onclick="erea()"
																		value="${p.shiyongren}" />
																</div>
															</td>
															
															<td class="bodyrow-list" align _columnindex="15">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.rukushijian}</div>
															</td>
															<td class="caption cao-l" colspan="1" rowspan="1">
																
																<div class="caotion-kf-txt"
																	style="overflow: hidden; text-align: center;">
																	<input type="button" onclick="erea(this.id)" id="${p.num}" value="${p.shiyongzhuangkuang}" >
																</div>


															</td>
															<td class="caption cao-l" colspan="1" rowspan="1">
																<div class="caotion-kf-txt"
																	style="overflow: hidden; text-align: center;">
																	<a href="BuyServlet?act=rizhi"><input type="button" " value="日志" ></a>
																		
																</div>
												

															</td>
															
														</tr>
														<c:set var="a" value="${a+1}"></c:set>
														<c:set var="b" value="${b+1}"></c:set>
													</c:forEach>
												</form>
											</tbody>
											
											
											

										</table>
	
									</div>
									<table border="0" cellpadding="0" cellspacing="1"
											class="fkbody-rows" >
									<div class="" tabindex="0" >
										<tbody>
											
												
												<form action="BuyServlet?act=fenyen1" method="post" id="fenye"  style=" text-align: center; ">
														
													<tr class="fkbody-s" _rowindex="0">
													
															<td class="caption cao-l" style=" text-align: center; width: 10;">
													<div class="caotion-kf-txt" style="overflow: hidden; text-align: center; width:50px; " id=""  >
														
													<input type="submit"  id="shang${p}" onclick="shanga(this.id)" value="上一页" /></div>
												</td>
												
												
													<c:forEach var="p" end="${length}" begin="1" >
														
															
															<td class="caption cao-l" style=" text-align: center; width: 10;">
													<div class="caotion-kf-txt" style="overflow: hidden; text-align: center; width: 10; " id=""  >
														
													<input type="submit"  id="fenye${p}" onclick="fenye(this.id)" value="${p}" />	</div>
												</td>
													</c:forEach> 
													
													
													
												
												
															<td class="caption cao-l" style=" text-align: center; width: 10;">
													<div class="caotion-kf-txt" style="overflow: hidden; text-align: center; width:50px; " id=""  >
														
													<input type="submit"  id="xia${p}" onclick="xia1(this.id)" value="下一页" /></div>
												</td>
																										
														</tr>
													</form>	
														
															
															
															
														
													
											
												
											</tbody>
											</div>
											</table>
									<form action="BuyServlet?act=lingyong" method="post"  id="xinxi" >
	<table border="1" cellspacing="0px" cellpadding="0px" style="text-align: center; width: 300; height: 310px;">
 
 
		 
 		<tr><td style="background-color: white;" >维&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;废&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;维&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单 </td><td><button type="button" onclick="yincang()"  style="float: right; height: 100%; border: 0PX; width: 100%;">X</button></td></tr>
 		<tr><td colspan="2">设备名称</td></tr>
		<tr><td colspan="2"><input type="" name="shebeiming" id="ming" value=""  style="width: 100%;height: 100%;"/></td></tr>
		<tr><td colspan="2">设备编码</td></tr>
		<tr><td colspan="2"><input type="" name="shebeibianma" id="zichan" value="" style="width: 100%;height: 100%;" /></td></tr>
		<tr><td colspan="2">使用部门</td></tr>
		<tr><td colspan="2"><input type="" name="bumen" id="" value="" style="width: 100%;height: 100%;" /></td></tr>
		
		
		<tr><td colspan="2">使用人姓名</td></tr>
		<tr><td colspan="2"><input type="" name="xingming" id="" value=""  style="width: 100%;height: 100%;" /></td></tr>
		<tr><td colspan="2"	><input type="button" name="" id="" value="是否确认提交"  onclick="queren()"  style="width: 100%;height: 100%;" /></td></tr>
		
			
 	</table>
	</form>
				
									<div class="lu">
										共<i>${a-1}</i>条记录
									

								</div>
								<div class="tab-btn">
									<div class="bt-f">
										<ul>
											<li>
												
						<a href="BuyServlet?act=daochu" class="special"><button class="button-li">选择导出</button></a>
											</li>
											<li>
					<a href="BuyServlet?act=weixiu_shenqing" class="special"><button class="button-li">维修申请</button></a>
											</li>
											<li>
												<button class="button-li">价格方式</button>
											</li>
										</ul>
									</div>
									<div class="bt-rg">
										<ul>
											<li><button>打印</button></li>
											<li><button>退出</button></li>
										</ul>
									</div>
								</div>
								<!--库房分配   结束-->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>

<script>
document.getElementById("change").value="显示全部";
var anhao= document.getElementById("anhao").innerHTML

 if(anhao=="已领用"){
	 
	  document.getElementById("change").value="已领用";
 }else if(anhao=="维修申请"){
	 
	  document.getElementById("change").value="维修申请";
 }else if(anhao=="未领用"){
	 
	  document.getElementById("change").value="未领用";
 }else if(anhao=="已报废"){
	 
	  document.getElementById("change").value="已报废";
 }

var a =document.getElementById("p").innerHTML



if(a=="B"){
	
	document.getElementById("baofeix").style.display="none";
	document.getElementById("weixiua").style.display="none";
	
	
	
	
	
	
}


function denglu(){
	 
	 var bl = confirm('确认重新登陆吗')
		
		if(bl==true){
			window.location.href="login.jsp";
		}
	 
	 
}




function shanga(id){
	
	var deng= document.getElementById("yeshu1").innerHTML;
	
	document.getElementById(id).name="shang";
	document.getElementById(id).value=deng;

	
}

function xia1(id){
	
	var deng= document.getElementById("yeshu1").innerHTML;
	
	document.getElementById(id).name="xia";
	document.getElementById(id).value=deng;
	
	
}

function fenye(a){
	
	
	document.getElementById(a).name="fe";
	
	
	
}


function baofei(){
	
	window.location.href = "BuyServlet?act=baofei";	
	
}

function queren(){
	
	var bl = confirm('确认提交吗')
	
	if(bl==true){
		document.getElementById("xinxi").submit()
	}
	
}
function erea(id){
	
	var neirong = document.getElementById(id).value
	if(neirong=="未领用"){
		
		
	var name=document.getElementById("ming"+id).innerHTML
	
	document.getElementById("ming").value=name
	
	var name1=document.getElementById("zichan"+id).value
	document.getElementById("zichan").value=name1
	
	document.getElementById("xinxi").style.display="block"
	}else if(neirong == "已领用"){
		var bl = confirm('确认取消领用吗')
		if(bl==true){
			
		
			var name1=document.getElementById("zichan"+id).value
			document.getElementById("zichan").value=name1
			document.getElementById("xinxi").submit()
		
		}
	}else if(neirong== "已报废"){
			alert("已报废不可修改")
			
				

		}
}

function yincang(){ 
	document.getElementById("xinxi").style.display="none"
		
				
}


		
	
	function change(value) { //筛选 领用或未领用
		var a = document.getElementById("change").value
		if (a == "未领用") {
			document.getElementById("change").value = "未领用";
			window.location.href = "BuyServlet?act=weilingyong";

		}
		if (a == "已领用") {
			document.getElementById("change").value = "已领用";
			window.location.href = "BuyServlet?act=yilingyong";

		}
		if (a == "显示全部") {

			window.location.href = "BuyServlet?act=kufang2";

		}
		if (a == "已报废") {

			window.location.href = "BuyServlet?act=baofei_cha";

		}
		if (a == "维修申请") {

			window.location.href = "BuyServlet?act=weixiu_shenqingshow";

		}
	}
	
</script>

</html>
